import { belongsTo, column } from '@adonisjs/lucid/orm'
import type { BelongsTo } from '@adonisjs/lucid/types/relations'

import Goods from '#models/goods'
import CommonBaseModel from '#common/base_model'

export default class ServiceRight extends CommonBaseModel {
  @column()
  declare fkGoodsId: number

  @column()
  declare name: string

  @column()
  declare times: number

  @column()
  declare giftTimes: number

  @column()
  declare normalPrice: number

  @column()
  declare salePrice: number

  @column()
  declare expNum: number

  @column()
  declare expType: number

  @column()
  declare expUnit: 'year' | 'month' | 'day'

  @column()
  declare status: number

  @column()
  declare memo: string

  @belongsTo(() => Goods)
  declare goods: BelongsTo<typeof Goods>
}
